package com.ruoyi.comprehensive.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.comprehensive.mapper.ReceiveVisitsMapper;
import com.ruoyi.comprehensive.domain.ReceiveVisits;
import com.ruoyi.comprehensive.service.IReceiveVisitsService;

/**
 * 接访信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-09-01
 */
@Service
public class ReceiveVisitsServiceImpl implements IReceiveVisitsService 
{
    @Autowired
    private ReceiveVisitsMapper receiveVisitsMapper;

    /**
     * 查询接访信息
     * 
     * @param id 接访信息主键
     * @return 接访信息
     */
    @Override
    public ReceiveVisits selectReceiveVisitsById(Long id)
    {
        return receiveVisitsMapper.selectReceiveVisitsById(id);
    }

    /**
     * 查询接访信息列表
     * 
     * @param receiveVisits 接访信息
     * @return 接访信息
     */
    @Override
    public List<ReceiveVisits> selectReceiveVisitsList(ReceiveVisits receiveVisits)
    {
        return receiveVisitsMapper.selectReceiveVisitsList(receiveVisits);
    }

    /**
     * 新增接访信息
     * 
     * @param receiveVisits 接访信息
     * @return 结果
     */
    @Override
    public int insertReceiveVisits(ReceiveVisits receiveVisits)
    {
        receiveVisits.setCreateTime(DateUtils.getNowDate());
        return receiveVisitsMapper.insertReceiveVisits(receiveVisits);
    }

    /**
     * 修改接访信息
     * 
     * @param receiveVisits 接访信息
     * @return 结果
     */
    @Override
    public int updateReceiveVisits(ReceiveVisits receiveVisits)
    {
        return receiveVisitsMapper.updateReceiveVisits(receiveVisits);
    }

    /**
     * 批量删除接访信息
     * 
     * @param ids 需要删除的接访信息主键
     * @return 结果
     */
    @Override
    public int deleteReceiveVisitsByIds(Long[] ids)
    {
        return receiveVisitsMapper.deleteReceiveVisitsByIds(ids);
    }

    /**
     * 删除接访信息信息
     * 
     * @param id 接访信息主键
     * @return 结果
     */
    @Override
    public int deleteReceiveVisitsById(Long id)
    {
        return receiveVisitsMapper.deleteReceiveVisitsById(id);
    }
}
